package com.info.widgets.Performance;
import java.util.ArrayList;
import java.util.List;
import java.sql.*;

import com.info.widgets.ConnectionHelper;
import com.info.widgets.DAOException;
import com.info.widgets.Joiningformalities.Joiningformalities;
import com.info.widgets.Performance.Performance;
public class PerformanceService {
	public ArrayList<Performance> PerformanceCreation(Performance eval) throws DAOException{
		System.out.println("PerformanceCreation");
		Performance eval1=new Performance();
		Connection con=null;
		String dbtime=null;
		//String query="SELECT * FROM mycaspian.performance_evaluationdg";
		ArrayList<Performance> arrayList = new ArrayList<Performance>();
		try {
			con=ConnectionHelper.getConnection();
			Statement stmt=con.createStatement();
			//ResultSet rs=stmt.executeQuery(query);
			PreparedStatement pst = null;
			pst = con.prepareStatement("INSERT INTO Performance (name, empid, group, location, project, period, appraiser, reviewer) VALUES(?, ?, ?, ?, ?, ?, ?, ?)");
			
			pst.setString(1, eval.getName());
			
			
			pst.executeUpdate();
		} catch (Exception e) {
			e.printStackTrace();
			throw new DAOException(e);
			
		}finally {
			ConnectionHelper.close(con);
			
		}
		 
		return arrayList;
		
		
		
	}
}